package com.example.consumer_order_feign_disabled_global.Controller;

import com.example.consumer_order_feign_disabled_global.feign.UserFeign;
import com.example.consumer_order_feign_disabled_global.model.UserInf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserFeign userFeign;

    @RequestMapping("/order/user/getById")
    @ResponseBody
//    @HystrixCommand(fallbackMethod = "com.example.consumer_order_feign_disabled_global.feign.FeignCallback.getById")
    public UserInf getById(String id){
        System.out.println("----------------- "+id+" --------------");
        return userFeign.getById(id);
    }

}
